function Managergeneral(url) 
{		
		var params ={
			'action': 'list_search',
			'IsProcess': "Y",
			'submited_event_hidden': $('#submited_event_hidden').val(),
			'submited_cat_hidden': $('#submited_cat_hidden').val(),
			'month_hid': $('#month_hid').val(),
			'year_hid': $('#year_hid').val(),
			'month2_hid': $('#month2_hid').val(),
			'year2_hid': $('#year2_hid').val(),
			'Search_keyword_hid': $('#Search_keyword_hid').val()
			};
		//$('#pagination ul li:last').after('<img src="images/indicator.gif" alt="Loading" title="Loading"/>');	
		$.ajax({
				type: "POST",
				url: url,
				data: params,				
				success: function(data){
					
					//alert(data);
						
						
						//$('#scroller').html(data);
						$('#paging').html(data);
						
				}
		});
}
function ManagerGeneral1(url) 
{	
		$('#sites').fadeOut(200);
		setTimeout("Manager1Ref('"+url+"')",300);
}

function Manager1Ref(url)
{	
	var params ={
			'IsProcess': "Y"
			};
		//$('#pagination ul li:last').after('<img src="images/indicator.gif" alt="Loading" title="Loading"/>');	
		$.ajax({
				type: "POST",
				url: url,
				data: params,				
				success: function(data){
					
					//alert(data);
					data = '<script src="jsthickbox/thickbox.js" type="text/javascript"></script>\n\n' + data;			
						$('#leftpannel').html(data);
						$('#sites').fadeIn(200);
				}
		});
}

function fetchSearchPages(item_per_page,Year,month)
{	
	/* getting hidden fields */
	var wherestr = "&submited_event_hidden="+$('#submited_event_hidden').val()+"&submited_cat_hidden="+$('#submited_cat_hidden').val()+"&month_hid="+$('#month_hid').val()+"&year_hid="+$('#year_hid').val()+"&month2_hid="+$('#month2_hid').val()+"&year2_hid="+$('#year2_hid').val()+"&Search_keyword_hid="+$('#Search_keyword_hid').val();	
	/* end getting hidden fields */
	$.ajax({
		   url:'gallery.php',
		   data:'action=list_search&IsProcess=Y&IsChangePerPage=N&page=1&cond=&item_per_page='+item_per_page+wherestr,
		   type:'post',		  
		   success:function(resp){
			   $('#paging').html(resp);
		   } 		   
	});
	
}

function checkLogin(login_email,login_password)
{
		
	$.ajax({
		   url:'check_login.php',
		   data:'action=check_login&user_email='+login_email+'&user_password='+login_password,
		   type:'post',		  
		   success:function(resp){
			   
			   if (resp==1)
			   {
			   $('#box_close').click();
			   $('#register_lnk').click();
			   }
			   if (resp==2)
			   {
			  	document.location.href = 'gallery.php';
			   }
		   } 		   
	});
	
}

function forgot_password(){
	if($('#forgot_email').val() == ""){
		$('#forgot_email').css("border","1px solid #FF0000");
	}
	else{
		$('#forgot_email').css("border","1px solid #003466");
	}
	$.post("ajax_functions.php",{'action':"forgot_password", login_email:$('#forgot_email').val()},function(data){
		$('#errmsg_for').html(data);
	});	
}

/**/
function ManagerGeneralMyPhoto(url) 
{	
		var params ={
			'IsProcess': "Y",
			'events' : $('#events').val()
			};
		//$('#pagination ul li:last').after('<img src="images/indicator.gif" alt="Loading" title="Loading"/>');	
		$.ajax({
				type: "POST",
				url: url,
				data: params,				
				success: function(data){
					
					//alert(data);
						
						
						//$('#scroller').html(data);
						$('#paging').html(data);
						
				}
		});
}
/*********/

/* Removes leading whitespaces Starts */

		function LTrim( value ) {

			

			var re = /\s*((\S+\s*)*)/;

			return value.replace(re, "$1");

			

		}

		// Removes ending whitespaces

		function RTrim( value ) {

			

			var re = /((\s*\S+)*)\s*/;

			return value.replace(re, "$1");

			

		}

		

		// Removes leading and ending whitespaces

		function trim( value ) {

			

			return LTrim(RTrim(value));

			

		}